package exam.huawei8_26;

import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @Description
 * @Author asrieal
 * @Date 2021/9/13
 *
 *
 */
public class main_hash {
    public static void main(String[] args) {
        Map<Integer,Integer> map = new HashMap<>();
        int[][] block = {{1,2,1},{1,3},{4}};
        int m = block.length;
        for (int i = 0; i < m; i++) {
            int star = 0;
            for (int j = 0; j < block[i].length-1; j++) {
                star+=block[i][j];
                map.put(star,map.getOrDefault(star,0)+1);
            }
        }
        int max = 0;
        for(Entry<Integer,Integer> entry : map.entrySet()){
            max = Math.max(entry.getValue(),max);
        }
        System.out.println(m-max);

    }

}
